ffi: validate 'void' as parameter type in getFunction and getFunctions#63504
ffi: validate 'void' as parameter type in getFunction and getFunctions#63504Anshikakalpana wants to merge 1 commit into
Conversation
8b78e7a to
58e5f70
Compare
|
No, this is wrong. Don't validate at JS level but within C++ level please. |
455f25e to
06410ff
Compare
Moved validation into the native FFI signature parsing layer in src/ffi/types.cc as suggested. Also removed the temporary JS-side validation. |
06410ff to
618bed6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63504 +/- ##
==========================================
+ Coverage 90.04% 90.32% +0.28%
==========================================
Files 713 730 +17
Lines 224484 234214 +9730
Branches 42430 43926 +1496
==========================================
+ Hits 202134 211559 +9425
- Misses 14156 14369 +213
- Partials 8194 8286 +92
🚀 New features to boost your workflow:
|
|
CI failures are relevant |
Hi @ShogunPanda, the Jenkins failures are from the old commit |
Fixes: nodejs#63461 Signed-off-by: Anshikakalpana <anshikajain196872@gmail.com>
618bed6 to
43c1eb8
Compare
|
Fixed the Windows failure — DynamicLibrary(null) rejects null on Windows. Now using kernel32.dll on Windows and null on Unix. Sorry for the multiple runs! |
Fixes: #63461
Passing
'void'as a parameter type ingetFunctionorgetFunctionstriggers an internal assertion instead of a user-friendly error.In C,
voidin a parameter list means a function takes no arguments, expressed in Node.js FFI as an empty array[]. There is no valid use case for'void'as a parameter type.Fix:
add early validation in
getFunctionandgetFunctionsthat throwsERR_INVALID_ARG_VALUEwhen'void'appears in the parameters array, beforewrapWithSharedBufferis called.